<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        ul {
            width: 500px;
            height: 500px;
            background: skyblue;
            list-style: none;
        }

        li {
            width: 100px;
            height: 100px;
            background: rebeccapurple;
            margin: 10px;
            float: left;
            text-align: center;
            color: white;
            line-height: 100px;

        }
    </style>
</head>

<body>
    <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
    </ul>

    <script>
        var ul = document.querySelector('ul')
        ul.onclick = function (e) {
            if(e.target.tagName==='LI'){
                console.log("li事件");
            }
            console.log(e.target.tagName);

        }

    </script>
</body>

</html>